package cn.famouscat.ex001;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LayoutAnimationController;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * Created by huangjin.
 * 2016/01/20
 */
public class MyListActivity extends ActionBarActivity {

    private static final String TAG = "MyListActivity";

    ListView lv;

    private String[] data = new String[]{"1111","2222","333","444","55","666666","77","8","9999","000","1","aaaa","vvv","bb","vvv","ddd"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list);

        lv = (ListView) findViewById(R.id.lv);

        Animation a = AnimationUtils.loadAnimation(this,android.R.anim.slide_in_left);

        LayoutAnimationController lac = new LayoutAnimationController(a);
        lac.setDelay(0.3f);
        lac.setOrder(LayoutAnimationController.ORDER_NORMAL);
        lv.setLayoutAnimation(lac);

        ArrayAdapter<String> aa = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,data);
        lv.setAdapter(aa);

        Log.d(TAG,"====="+lv.getAdapter().getCount());
    }

    public void onBtnClick(View v){
        finish();
        overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out);
    }



}
